package com.jersey;

import java.io.Serializable;


public abstract class AbstractFeedData<T> implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = -5332708558640954189L;
	private ResponseMessage responseMessage = ResponseMessage.Success;
	private T data;
	
	public AbstractFeedData() {
	}
	public AbstractFeedData(ResponseMessage responseMessage, T data) {
		this.responseMessage = responseMessage;
		setData(data);
	}
	
	public ResponseMessage getResponseMessage() {
		return responseMessage;
	}
	public void setResponseMessage(ResponseMessage responseMessage) {
		this.responseMessage = responseMessage;
	}
	
	public T getData() {
		return data;
	}

	public void setData(T data) {
		this.data = data;
	}

	public int getResponseCode() {
		return getResponseMessage().getCode();
	}
	
	public String getMessage() {
		return getResponseMessage().getErrorMessage();
	}
	
}
